﻿using ACC.Extensions.ClientBusiness;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ACC.Extensions.PCClient.Entities
{
    /// <summary>
    /// 基本信息
    /// </summary>
   public class ClientBasicInfo : INotifyPropertyChanged
    {
       public event PropertyChangedEventHandler PropertyChanged;

       /// <summary>
       /// 工站名称
       /// </summary>
       private string stnName;     
       public string StnName 
       {
           get { return string.IsNullOrEmpty(stnName)?" ":stnName ; }
           set
           {
               stnName = value;
               if (PropertyChanged != null)
               {
                   PropertyChanged.Invoke(this, new PropertyChangedEventArgs("StnName"));
               }
           }
       }

       /// <summary>
       /// 工站描述
       /// </summary>
       private string stnDesc;      
       public string StnDesc
       {
           get { return string.IsNullOrEmpty(stnDesc) ? StnName : stnDesc; }
           set
           {
               stnDesc = value;
               if (PropertyChanged != null)
               {
                   PropertyChanged.Invoke(this, new PropertyChangedEventArgs("StnDesc"));
               }
           }
       }

       /// <summary>
       /// 产品型号
       /// </summary>
       private string partNo;       
       public string PartNo 
       {
           get { return string.IsNullOrEmpty(partNo)?" ":partNo; }
           set
           {
               partNo = value;
               if (PropertyChanged != null)
               {
                   PropertyChanged.Invoke(this, new PropertyChangedEventArgs("PartNo"));
               }
           }
       }

       /// <summary>
       /// 产品型号描述
       /// </summary>
       private string partNoDesc;      
       public string PartNoDesc
       {
           get { return string.IsNullOrEmpty(partNoDesc) ? PartNo : partNoDesc; }
           set
           {
               partNoDesc = value;
               if (PropertyChanged != null)
               {
                   PropertyChanged.Invoke(this, new PropertyChangedEventArgs("PartNoDesc"));
               }
           }
       }

       /// <summary>
       /// 班次
       /// </summary>
       private string shift;      
       public string Shift
       {
           get { return string.IsNullOrEmpty(shift) ? " " : shift;}
           set
           {
               shift = value;
               if (PropertyChanged != null)
               {
                   PropertyChanged.Invoke(this, new PropertyChangedEventArgs("Shift"));
               }
           }
       }

       /// <summary>
       /// 托盘号
       /// </summary>
       private string palletNo;      
       public string PalletNo
       {
           get { return string.IsNullOrEmpty(palletNo) ? " " : palletNo; }
           set
           {
               palletNo = value;
               if (PropertyChanged != null)
               {
                   PropertyChanged.Invoke(this, new PropertyChangedEventArgs("PalletNo"));
               }
           }
       }

       /// <summary>
       /// GBSN
       /// </summary>
       private string gbSn;
       public string GbSn
       {
           get { return string.IsNullOrEmpty(gbSn) ? " " : gbSn; }
           set
           {
               gbSn = value;
               if (PropertyChanged != null)
               {
                   PropertyChanged.Invoke(this, new PropertyChangedEventArgs("GbSn"));
               }
           }
       }

       /// <summary>
       /// 订单号
       /// </summary>
       private string orderNo;     
       public string OrderNo
       {
           get { return string.IsNullOrEmpty(orderNo) ? " " : orderNo; }
           set
           {
               orderNo = value;
               if (PropertyChanged != null)
               {
                   PropertyChanged.Invoke(this, new PropertyChangedEventArgs("OrderNo"));
               }
           }
       }

       /// <summary>
       /// 订单数量
       /// </summary>
       private int orderQty;      
       public int OrderQty
       {
           get { return orderQty; }
           set
           {
               orderQty = value;
               if (PropertyChanged != null)
               {
                   PropertyChanged.Invoke(this, new PropertyChangedEventArgs("OrderQty"));
               }
           }
       }

       /// <summary>
       /// 操作工
       /// </summary>
       private string stnOperator;     
       public string StnOperator
       {
           get { return stnOperator; }
           set
           {
               stnOperator = value; 
               if (PropertyChanged != null)
               {
                   PropertyChanged.Invoke(this, new PropertyChangedEventArgs("StnOperator"));
               }
           }
       }

       /// <summary>
       /// OK数量
       /// </summary>
       private int okCount;     
       public int OkCount
       {
           get { return okCount; }
           set
           {
               okCount = value;
               if (PropertyChanged != null)
               {
                   PropertyChanged.Invoke(this, new PropertyChangedEventArgs("OkCount"));
               }
           }
       }

       /// <summary>
       /// 是否显示OK数量
       /// </summary>
       private bool showOKCount;      
       public bool ShowOKCount
       {
           get { return showOKCount; }
           set
           {
               showOKCount = value;
               if (PropertyChanged != null)
               {
                   PropertyChanged.Invoke(this, new PropertyChangedEventArgs("ShowOKCount"));
               }
           }
       }

       /// <summary>
       /// 清空数据
       /// </summary>
       public void Clear()
       {
           StnName = "";
           StnDesc = "";
           PartNo = "";
           PartNoDesc= "";
           Shift= "";
           PalletNo= "";
           OrderNo = "";
           OrderQty= 0;
           StnOperator = "";
           OkCount = 0;
       }

    }
}
